load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "go_default_library",
    srcs = [
        "cpu_plugin.go",
        "kvm-caps-info-plugin_amd64.go",
        "kvm-caps-info-plugin_arm64.go",
        "model.go",
        "node_labeller.go",
    ],
    cgo = True,
    importpath = "kubevirt.io/kubevirt/pkg/virt-handler/node-labeller",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/util/types:go_default_library",
        "//pkg/virt-config:go_default_library",
        "//pkg/virt-handler/node-labeller/api:go_default_library",
        "//pkg/virt-handler/node-labeller/util:go_default_library",
        "//staging/src/kubevirt.io/api/core/v1:go_default_library",
        "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
        "//staging/src/kubevirt.io/client-go/log:go_default_library",
        "//vendor/k8s.io/api/core/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
        "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library",
        "//vendor/k8s.io/client-go/util/workqueue:go_default_library",
    ],
)

go_test(
    name = "go_default_test",
    srcs = [
        "capabilities_test.go",
        "cpu_plugin_test.go",
        "node_labeller_suite_test.go",
        "node_labeller_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":go_default_library"],
    deps = [
        "//pkg/virt-handler/node-labeller/api:go_default_library",
        "//vendor/github.com/onsi/ginkgo:go_default_library",
        "//vendor/github.com/onsi/gomega:go_default_library",
    ] + select({
        "@io_bazel_rules_go//go/platform:amd64": [
            "//pkg/testutils:go_default_library",
            "//pkg/virt-config:go_default_library",
            "//pkg/virt-handler/node-labeller/util:go_default_library",
            "//staging/src/kubevirt.io/api/core/v1:go_default_library",
            "//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
            "//staging/src/kubevirt.io/client-go/log:go_default_library",
            "//staging/src/kubevirt.io/client-go/testutils:go_default_library",
            "//tests:go_default_library",
            "//vendor/github.com/golang/mock/gomock:go_default_library",
            "//vendor/k8s.io/api/core/v1:go_default_library",
            "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
            "//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
            "//vendor/k8s.io/client-go/kubernetes/fake:go_default_library",
            "//vendor/k8s.io/client-go/testing:go_default_library",
        ],
        "//conditions:default": [],
    }),
)
